<?php
	DEFINE('H1', 'Pizza Topping Selector');
	DEFINE('TITLE','Pizza Topping Selector');
	require('includes/header.php');
?>	
	<h2><?PHP echo H1 ?></h2>

<?php

if(!isset ($_POST['submit'])) {

?>

<form method="post" action="<?php echo $_SERVER['PHP_SELF']?>">
Select your favorite pizza toppings:<br />
<input type="checkbox" name="toppings[]" value="tomato">Tomato</input>
<input type="checkbox" name="toppings[]" value="onion">Onion</input>
<input type="checkbox" name="toppings[]" value="jalapenos">Jalapeno Peppers</input>
<input type="checkbox" name="toppings[]" value="olives">Olives</input>
<input type="checkbox" name="toppings[]" value="mint">Mint</input>
<input type="checkbox" name="toppings[]" value="pineapple">Pineapple</input>
<input type="checkbox" name="toppings[]" value="bacon">Bacon</input>
<input type="checkbox" name="toppings[]" value="chicken">Chicken</input>
<input type="checkbox" name="toppings[]" value="ham">Ham</input>
<input type="checkbox" name="toppings[]" value="anchovies">Anchovies</input>
<input type="checkbox" name="toppings[]" value="x-cheese">Extra Cheese</input>
<p><input type="submit" name="submit" value="submit" /></p>
</form>

<?php } else {
?>
You selected the following toppings:<br />
<ul>
<?php 
print_r($_POST['toppings']);
?><br /><?php
var_dump($_POST['toppings']);

foreach ($_POST['toppings'] as $t) {
echo "<li>$t</li> \r\n";} 
}
?>
</ul>

<?php
	require('includes/footer.php');
?>